home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / haziran / 19 / setup.exe / data.z / speaker.c < prev    next >
C/C++ Source or Header  |  2001-04-11  |  898b  |  36 lines

  1. ////////////////////////////////////////////////////////////////
  2. // File - speaker.c
  3. //
  4. // This application plays a tone on the speaker, accessing it 
  5. // directly on the motherboard using WinDriver.
  6. // 
  7. ////////////////////////////////////////////////////////////////
  8.  
  9. #include "speaker_lib.h"
  10. #include <stdio.h>
  11.  
  12. int main(int argc, char *argv[])
  13. {
  14.     SPEAKER_HANDLE hSPEAKER = NULL;
  15.  
  16.     printf ("SPEAKER diagnostic utility.\n");
  17.     printf ("Application accesses hardware using " WD_PROD_NAME ".\n");
  18.  
  19.     if (!SPEAKER_Open(&hSPEAKER))
  20.     {
  21.         printf("error while opening SPEAKER:\n");
  22.         printf("%s", SPEAKER_ErrorString);
  23.         return 0;
  24.     }
  25.  
  26.     SPEAKER_Tone(hSPEAKER, 440, 200);
  27.     SPEAKER_Tone(hSPEAKER, 554, 200);
  28.     SPEAKER_Tone(hSPEAKER, 659, 200);
  29.     SPEAKER_Tone(hSPEAKER, 880, 800);
  30.  
  31.     SPEAKER_Close(hSPEAKER);
  32.  
  33.     return 0;
  34. }
  35.  
  36.